import React, {Component} from 'react';
import {connect} from 'react-redux';
import {
    RecommendWrapper,
    RecommendItem,
}from '../style'
class Recommend extends Component {
    render() {
        const {list} = this.props;//解构语法
        return (
            <RecommendWrapper>
                {
                    list.map((item) =>{
                        return <RecommendItem key={item.get('id')} imgUrl={item.get('imgUrl')}/>
                    })
                }
            </RecommendWrapper>
        )
    }
}

const mapStateToProps = (state) => ({
    list: state.get('home').get('recommendList'),
})

// ({}) 等价于 {return ...}

export default connect(mapStateToProps, null)(Recommend);